//package projet_final;
//
//import java.awt.BorderLayout;
//import java.awt.Color;
//import java.awt.Dimension;
//import java.awt.FlowLayout;
//import java.awt.Graphics;
//import java.awt.GridLayout;
//import java.awt.Image;
//import java.awt.event.ActionEvent;
//import java.awt.event.ActionListener;
//import java.util.ArrayList;
//
//import javax.swing.ImageIcon;
//import javax.swing.JButton;
//import javax.swing.JFrame;
//import javax.swing.JLabel;
//import javax.swing.JPanel;
//
//@SuppressWarnings("serial")
//public class CreateImage extends JPanel implements ActionListener {
//	private JPanel panel;
//	private JButton quitter;
//	private JLabel lab;
//	private String name;
//	private Image img;
//	private JFrame frameImg;
//	
//	public CreateImage(String name1) {
//		this.name = name1;
//		this.img = getToolkit().getImage(name1);
//		this.frameImg = new JFrame();
//		this.frameImg.setTitle("affichage de l'image");
//		this.frameImg.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
//		this.frameImg.setSize(450, 550);
//		this.frameImg.setLocation(200, 200);
//		//creation du panel qui va ajouter tt les pan a la frame
//		this.panel = new JPanel(new GridLayout(2, 1));
//		this.frameImg.setContentPane(panel);
////		creation du panel qui va afficher l' image
//		JPanel imagepan = new JPanel();
//		JPanel buttonpan = new JPanel ();
//
//		//ajout les deux panels au panel principal
//		this.panel.add(imagepan);
//		this.panel.add(buttonpan);
//		//creation du boutoon quitter
//		this.quitter = new JButton("quitter");
//		this.quitter.setMaximumSize(new Dimension(50,50));
//		this.quitter.addActionListener(new ActionListener() {
//			public void actionPerformed(ActionEvent e) {
//				frameImg.dispose();
//			}
//		});
//		
//		this.lab = new JLabel(new ImageIcon(img));
//		//ajoute les differents bouton dans le panel
//		imagepan.add(lab);
//		buttonpan.add(quitter, BorderLayout.SOUTH);
//		//change le background du panel
//		imagepan.setBackground(Color.GRAY);
//		imagepan.repaint();
//		this.frameImg.setVisible(true);
//		this.frameImg.pack();
//	}
//	
//	public void paintComponent(Graphics g) {
//		Image current = getToolkit().getImage(name);
//		g.drawImage(this.img, 0, 0, this);
//	}
//	
////	protected void paintComponent(Graphics g) {
////		int x = 0;
////		int y = 0;
////		int width = 0;
////		int height = 0;
////		width = this.img.getWidth(this);
////		height = this.img.getHeight(this);
////		x = ((this.getWidth() - width) / 2);
////		y = ((this.getHeight() - height) / 2);
////		g.drawImage(this.img, x, y, width, height, this);
////	}
//	@Override
//	public void actionPerformed(ActionEvent arg0) {
//		// TODO Auto-generated method stub
//	}
//
//    /**
//     * Exemple : jPanelImage dans un JFrame
//     * @param args
//     *
//    public static void main(String[] args) {
//        JImagePanel imagePanel = new JImagePanel("c:\\monimage.jpg");
//        //Centrer l'image
//        imagePanel.setStretch(false);
//        //Etirer l'image
//       // imagePanel.setStretch(true);
//
//        JFrame frame = new JFrame();
//        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//        frame.add(imagePanel);
//        frame.setSize(400, 400);
//        frame.setLocation(200, 200);
//        frame.setVisible(true);
//    }
//	 */
//
//}
